package com.wms.controller;


import com.wms.common.Result;
import com.wms.entity.Menu;
import com.wms.entity.User;
import com.wms.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author czh
 * @since 2025-06-10
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    @PostMapping("/list")
    public Result list(@RequestBody int roleId) {
        // 将 roleId 从 int 转换为 String
        String roleIdStr = String.valueOf(roleId);

        // 使用 roleIdStr 进行查询
        List<Menu> list = menuService.lambdaQuery().like(Menu::getMenuright, roleIdStr).list();
        return Result.success(list);
    }
}

